Skip to content

Show offers in dstack apply for elastic container fleets#3754

Merged
peterschmidt85 merged 3 commits intomasterfrom
fix/fleet-elastic-container-offers
Apr 10, 2026
Merged

Show offers in dstack apply for elastic container fleets#3754
peterschmidt85 merged 3 commits intomasterfrom
fix/fleet-elastic-container-offers

Conversation

@peterschmidt85
Copy link
Copy Markdown
Contributor

@peterschmidt85 peterschmidt85 commented Apr 7, 2026

Steps to reproduce

type: fleet
name: my-fleet

# Elastic/template fleet (provision on demand)
nodes: 0..1

backends: [runpod]
spot_policy: auto
idle_duration: 10m
dstack apply -f fleet.dstack.yml
Project        main
User           admin
Configuration  fleet.dstack.yml
Type           fleet
Fleet type     cloud
Nodes          min=0 target=0 max=1
Backends       runpod
Resources      cpu=2.. mem=8GB.. disk=100GB.. gpu=0..
Spot policy    auto

No matching instance offers available. Possible reasons:
https://dstack.ai/docs/guides/troubleshooting/#no-offers

Expected

dstack apply should show matching offers for elastic container-based fleets, since runs are provisioned on demand from those offers.

This is important not only for offer visibility/convenience, but also for consistency: VM-based elastic fleets already show offers during apply, and container-based elastic fleets should behave the same way.

Actual

No offers were shown for elastic container-based fleets during apply, even when offers existed.

Solution

Refactored fleet offer semantics to avoid duplicating branches while preserving behavior:

  • Added get_fleet_offers(...) as the shared offer lookup for fleet planning/provisioning.
  • get_fleet_offers(...) defaults to filtering by BACKENDS_WITH_CREATE_INSTANCE_SUPPORT.
  • Removed get_create_instance_offers(...); create-instance paths now call get_fleet_offers(...) with include_only_create_instance_supported_backends=True explicitly.
  • In get_plan(...), when nodes.target == 0, we call get_fleet_offers(...) with create-instance filtering disabled, so elastic Runpod/container offers are shown.
  • Removed _is_elastic_cloud_fleet_spec(...) helper and switched to direct nodes.target semantics.

This keeps non-elastic behavior unchanged while fixing elastic container fleet offer visibility in dstack apply.

AI Assistance

This PR was prepared with AI assistance (Codex).

Use run-capable offer lookup for cloud fleets with nodes.min=0 and nodes.target=0, while keeping create-instance filtering for non-elastic fleets.\n\nAdds router tests for elastic container backend offers and preserves no-offers behavior for non-elastic container fleets.
@peterschmidt85 peterschmidt85 requested a review from r4victor April 7, 2026 19:46
@peterschmidt85 peterschmidt85 changed the title Show offers for elastic container fleets Show offers in dstack apply for elastic container fleets Apr 7, 2026
@peterschmidt85 peterschmidt85 merged commit da026f9 into master Apr 10, 2026
26 checks passed
@peterschmidt85 peterschmidt85 deleted the fix/fleet-elastic-container-offers branch April 10, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants